package com.example.hxpc.guidancemanagement.adapter;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentStatePagerAdapter;
import android.support.v4.view.ViewPager;
import android.view.ViewGroup;

import java.util.ArrayList;

/**
 * Created by tao on 2017/11/29.
 * 主页面页面滑动的适配器
 */

public class MyFrageStatePagerAdapter extends FragmentStatePagerAdapter {
    private ArrayList<Fragment> mFramentList;

    public MyFrageStatePagerAdapter(FragmentManager fm , ArrayList<Fragment> mFramentList) {
        super(fm);
        this.mFramentList = mFramentList;
    }

    @Override
    public Fragment getItem(int position) {
        return mFramentList.get(position);
    }

    @Override
    public int getCount() {
        return mFramentList!=null?mFramentList.size():0;
    }

}
